package com.shopnight.utils;

import com.shopnight.result.ApiResult;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;

public class ExceptionUtil {

    @ExceptionHandler(Exception.class)
    @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
    public ApiResult handleUnexpectedServer(Exception ex){
        return ApiResult.fail(ex.getMessage());
    }

}
